package cn.lyjuan.android.demofive.ui.component.auto_complete_textview;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import cn.lyjuan.android.demofive.R;

/**
 * Created by chad on 16-1-11.
 */
public class AutoCompleteTextView extends Activity
{
    String[] str = new String[]{"abc", "ab1", "ab2", "ab3", "ab4", "112", "113213423", "11453454"};

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        this.setContentView(R.layout.ui_auto_complete_textview);

        // native
        android.widget.AutoCompleteTextView text = (android.widget.AutoCompleteTextView) this.findViewById(R.id.ui_auto_complete_textview_native);
        text.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, str));

        // completionHint
        text = (android.widget.AutoCompleteTextView) this.findViewById(R.id.ui_auto_complete_textview_completionhint);
        text.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, str));

        // completionThreshold
        text = (android.widget.AutoCompleteTextView) this.findViewById(R.id.ui_auto_complete_textview_completionThreshold);
        text.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, str));
    }
}
